package com.photohistory.hibernate.beans;
// Generated 31.03.2010 12:15:52 by Hibernate Tools 3.2.4.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * SpecialPlaces generated by hbm2java
 */
@Entity
@Table(name="special_places"
    ,catalog="mytest"
)
public class SpecialPlaces  implements java.io.Serializable {


     private Integer id;
     private City city;
     private Town town;
     private String name;
     private Set<Categoryhasspecialplaces> categoryhasspecialplaceses = new HashSet<Categoryhasspecialplaces>(0);

    public SpecialPlaces() {
    }

	
    public SpecialPlaces(City city, String name) {
        this.city = city;
        this.name = name;
    }
    public SpecialPlaces(City city, Town town, String name, Set<Categoryhasspecialplaces> categoryhasspecialplaceses) {
       this.city = city;
       this.town = town;
       this.name = name;
       this.categoryhasspecialplaceses = categoryhasspecialplaceses;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="id", unique=true, nullable=false)
    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="city_id", nullable=false)
    public City getCity() {
        return this.city;
    }
    
    public void setCity(City city) {
        this.city = city;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="town_id")
    public Town getTown() {
        return this.town;
    }
    
    public void setTown(Town town) {
        this.town = town;
    }

    
    @Column(name="name", nullable=false, length=256)
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="specialPlaces")
    public Set<Categoryhasspecialplaces> getCategoryhasspecialplaceses() {
        return this.categoryhasspecialplaceses;
    }
    
    public void setCategoryhasspecialplaceses(Set<Categoryhasspecialplaces> categoryhasspecialplaceses) {
        this.categoryhasspecialplaceses = categoryhasspecialplaceses;
    }
    public String toString(){
    	
    	return name;
    }



}


